# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=cri-tools
pkgver=1.31.1
pkgrel=0
pkgdesc="CLI tool for Kubelet Container Runtime Interface (CRI)"
url="https://github.com/kubernetes-sigs/cri-tools"
arch="all !armhf"
license="Apache-2.0"
makedepends="go"
options="!check" # no check available
source="$pkgname-$pkgver.tar.gz::https://github.com/kubernetes-sigs/cri-tools/archive/v$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

build() {
case "$CARCH" in
	armv7|riscv64|s390x|x86|loongarch64) CGO_ENABLED=1 make all;;
	*) make all;;
esac
}

check() {
	make test
}
package() {
	make BINDIR="$pkgdir"/usr/bin install
}

sha512sums="
a72946944207d20f27236da12f7c2d532a1c9ebc881c3af4709494f7abc6f7b2d421934006a535a0b4a35926f09f58315ff0aaf4da870fd5a65281f547ef86a1  cri-tools-1.31.1.tar.gz
"
